%% Colebrook
function [P2,Ppj]=Colebrook(Tpj,P1,lambda,a_coeff,s,Q,d,Z,relative_den)

del_x=1;%km
Tpj=Tpj+273.15;
d=d/1000;
Q=Q/(10^6)*(24*3600); %Nm3/s -> 10^6Nm3/d
P1=P1+101.325*10^-3;
%C0=0.03848 m2*s*K^0.5/kg
C0=104.9876;

%P2=((P1^2-Q^2/(C0^2*d^5)*lambda*Z*Tpj*relative_den*del_x*(1+a_coeff/2*(gc1+gc2)))/(1+a_coeff*s))^0.5;
P2=(P1^2-Q^2/(C0^2*d^5)*lambda*Z*Tpj*relative_den*del_x)^0.5;
Ppj=2/3*(P1+P2^2/(P1+P2));
P2=P2-101.325*10^-3;
Ppj=Ppj-101.325*10^-3;
end

